from django.shortcuts import render
from rest_framework import generics,viewsets
from rest_framework.views import APIView
from rest_framework import status
from rest_framework.response import Response

from .models import Vacate,Notice,Attendance
from .serializers import VacateSerializer,NoticeSerializer,AttendanceSerializer


# Create your views here.
class VacateList(generics.ListCreateAPIView):
    queryset = Vacate.objects.all()
    serializer_class = VacateSerializer


class VacateDetail(generics.RetrieveUpdateDestroyAPIView):
    queryset = Vacate.objects.all()
    serializer_class = VacateSerializer

class NoticeViewSet(viewsets.ModelViewSet):
    queryset = Notice.objects.all()
    serializer_class = NoticeSerializer

class AttendanceViewSet(viewsets.ModelViewSet):
    queryset = Attendance.objects.all()
    serializer_class = AttendanceSerializer